Skip to content

feat: add optional context parameter to moveCursorTo#5492

Merged
DavertMik merged 2 commits into4.xfrom
feat/moveCursorTo-context
Mar 17, 2026
Merged

feat: add optional context parameter to moveCursorTo#5492
DavertMik merged 2 commits into4.xfrom
feat/moveCursorTo-context

Conversation

@DavertMik
Copy link
Contributor

Summary

  • Add optional context parameter to moveCursorTo in Playwright, Puppeteer, and WebDriver helpers
  • When the second argument is a non-number (string/locator), it is treated as a context element to scope the search, matching the pattern used by click, seeElement, etc.
  • Supports both I.moveCursorTo('#el', 'body') (context) and I.moveCursorTo('#el', 5, 5) (offset) signatures

Test plan

  • Existing moveCursorTo tests pass (no regression)
  • New context test passes for Playwright
  • Verify Puppeteer context test
  • Verify WebDriver context test

🤖 Generated with Claude Code

DavertMik and others added 2 commits March 17, 2026 04:45
Allow scoping moveCursorTo to a parent element by passing a context
locator as the second argument, matching the pattern used by click,
seeElement, etc. When the second arg is non-number, it is treated
as context instead of offsetX.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…uppeteer

In Puppeteer, this.context is scoped to <body>, so searching for "body"
within it returns empty. Use this.page directly to find the context
element from the document root.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@DavertMik DavertMik merged commit 04ae7f0 into 4.x Mar 17, 2026
10 checks passed
@DavertMik DavertMik deleted the feat/moveCursorTo-context branch March 17, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant